<?php
/**
 * Created by PhpStorm.
 * User: a4041
 * Date: 2018/6/13
 * Time: 13:46
 */

namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class ShopMenu extends Model
{
    //软删除
    use SoftDeletes;
    protected $guarded = ['id'];
    //指定数据表
    protected $table = 'shop_menu';
    //隐藏不必要字段
    protected $hidden = ['deleted_at'];
    /**
     * 获取菜单目录对应的菜
     */
    public function shopdish()
    {
        return $this->hasMany('App\Models\ShopDish','menu_id','id');
    }

    public function shop()
    {
        return $this->hasOne('App\Models\Shop','id','shop_id');
    }

}